// packageF/others/customerCenter/component/trackList/trackList.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    list: {
      type: Array,
      value: []
    },
    display_set: {
      type: null
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    telCall(e) {
      let phone = e.currentTarget.dataset.phone;
      wx.makePhoneCall({
        phoneNumber: phone
      })
    },
    onCopyWechat(e) {
      let wechat = e.currentTarget.dataset.wechat;
      wx.setClipboardData({
        data: wechat,
        success: () => {
          wx.hideToast()
          wx.showModal({
            content: '复制微信号成功',
            showCancel: false
          })
        }
      })
    },
    toUrl(e) {
      let url = e.currentTarget.dataset.url;
      wx.redirectTo({
        url: '/' + url,
        fail: (err) => {
          wx.setClipboardData({
            data: url,
            success: () => {
              wx.hideToast()
              wx.showModal({
                content: '复制成功',
                showCancel: false
              })
            }
          })
        }
      })
    },
    onCopyUrl(e) {
      let url = e.currentTarget.dataset.url;
      wx.setClipboardData({
        data: url,
        success: () => {
          wx.hideToast()
          wx.showModal({
            content: '复制成功',
            showCancel: false
          })
        }
      })
    }
  }
})